package com.hwpt.hwaccount.feature.personalinfo;

import android.net.Uri;

import com.hwpt.hwaccount.core.base.BaseContract;
import com.hwpt.hwaccount.core.data.local.entity.UserEntity;

public interface PersonalInfoContract {

    interface View extends BaseContract.View {
        void showUserInfo(UserEntity user);

        void showAvatar(Uri imageUri);

        void showAvatarLoadError(String message);

        void showRealnameInputDialog(); // 显示实名认证输入对话框

        void showRealnameInfo(String maskedRealName, String maskedIdCard); // 显示脱敏的实名信息

    }


    interface Presenter extends BaseContract.Presenter<View> {
        void loadUserInfo();

        void updateNickname(String nickname);

        void updateGender(int gender);

        void updateBirthday(String birthday);

        void updateRegion(String region);

        void updateAvatar(String avatarUrl);

        void doRealNameAuth(String realName, String idCard);

        void checkRealnameInfo();
    }

    interface Model extends BaseContract.Model {
        void getUserInfo(DataCallback<UserEntity> callback);

        void updateUserInfo(UserEntity user, DataCallback<Boolean> callback);

        void updateAvatar(String accountId, String avatarUrl, DataCallback<Boolean> callback);

        interface DataCallback<T> {
            void onSuccess(T data);

            void onError(String message);
        }
    }
}